﻿using System;
using System.Buffers;
using Beefly.Json.Extensions;
using Beefly.Json.Meta;

namespace Beefly.Json.Formats;

sealed class UInt32JsonFormat : AJsonFormat<uint>
{
    public override void Serialize(IBufferWriter<char> writer, ref uint item)
    {
        writer.WriteNumberChar(ref item);
    }

    public override uint Deserialize(in Span<char> str)
    {
        return uint.Parse(str);
    }
}